package P1000;

import java.util.Scanner;

/**
 * @author: zhouyang
 * @descrpition:
 * @time: 2019-10-05 20:27
 */
public class P1085_不高兴的津津 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int max = 0,date = 0;
        for(int i=0;i<7;++i){
            int now = scanner.nextInt()+scanner.nextInt();
            if(now > max){
                max = now;
                if(max > 7) date = i+1;
            }
        }
        scanner.close();
        System.out.println(date);
    }
}
